package com.szqhyxj.youxiangju.biz.partnerHome.home.peasonalperformancerepayment;

import com.google.gson.annotations.SerializedName;

import com.szqhyxj.youxiangju.sys.BaseResult;
import com.szqhyxj.youxiangju.sys.RetrofitFacade;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by leung on 2018/11/21.
 */

public class PeasonalPerformanceRepaymentModel {
    private interface PartnerEquipmentPaymentService{
        @FormUrlEncoded
        @POST("monthresults/monthList")
        Observable<BaseResult<PeasonalPerformanceRepaymentEntity>> partnerEquipmentPayment(
                @Field("organType") int organType,
                @Field("statisticsType") int statisticsType,
                @Field("pageSize") int pageSize,
                @Field("pageNumber") int pageNumber
        );

        @FormUrlEncoded
        @POST("monthresults/monthList")
        Observable<BaseResult<PeasonalPerformanceRepaymentEntity>> onepartnerEquipmentPayment(
                @Field("organName") String organName
        );
    }

    public static Observable<BaseResult<PeasonalPerformanceRepaymentEntity>> getpartnerEquipmentPayment(int organType,int statisticsType,int pageSize,int pageNumber ) {
        return RetrofitFacade.Companion.getRetrofit().create(PartnerEquipmentPaymentService.class).partnerEquipmentPayment(
                organType,
                statisticsType,
                pageSize,
                pageNumber
        );
    }

    public static Observable<BaseResult<PeasonalPerformanceRepaymentEntity>> getonepartnerEquipmentPayment(String organName) {
        return RetrofitFacade.Companion.getRetrofit().create(PartnerEquipmentPaymentService.class).onepartnerEquipmentPayment(
                organName
        );
    }

    public static class PeasonalPerformanceRepaymentEntity{

        @SerializedName("total")
        private int total;

        @SerializedName("rows")
        private List<PeasonalRowsItem> rows;

        public void setTotal(int total){
            this.total = total;
        }

        public int getTotal(){
            return total;
        }

        public void setRows(List<PeasonalRowsItem> rows){
            this.rows = rows;
        }

        public List<PeasonalRowsItem> getRows(){
            return rows;
        }

        @Override
         public String toString(){
            return
                "TeamPerformanceRepaymentEntity{" +
                "total = '" + total + '\'' +
                ",rows = '" + rows + '\'' +
                "}";
            }
    }
}
